home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2018 July / PCgo 07-2018 CD-ROM Germany.iso / nw.pak / Unnamed File 004766.unknown < prev    next >
Encoding:
Text File  |  2015-07-29  |  7.3 KB  |  52 lines

  1. WebInspector.LayerPaintProfilerView=function(showImageForLayerCallback)
  2. {WebInspector.SplitView.call(this,true,false);this._showImageForLayerCallback=showImageForLayerCallback;this._logTreeView=new WebInspector.PaintProfilerCommandLogView();this.setSidebarView(this._logTreeView);this._paintProfilerView=new WebInspector.PaintProfilerView(this._showImage.bind(this));this.setMainView(this._paintProfilerView);this._paintProfilerView.addEventListener(WebInspector.PaintProfilerView.Events.WindowChanged,this._onWindowChanged,this);}
  3. WebInspector.LayerPaintProfilerView.prototype={profileLayer:function(layer)
  4. {this._logTreeView.setCommandLog(null,[]);this._paintProfilerView.setSnapshotAndLog(null,[],null);layer.requestSnapshot(onSnapshotDone.bind(this));function onSnapshotDone(snapshot)
  5. {this._layer=layer;snapshot.commandLog(onCommandLogDone.bind(this,snapshot));}
  6. function onCommandLogDone(snapshot,log)
  7. {this._logTreeView.setCommandLog(snapshot.target(),log);this._paintProfilerView.setSnapshotAndLog(snapshot||null,log||[],null);}},_onWindowChanged:function()
  8. {var window=this._paintProfilerView.windowBoundaries();this._logTreeView.updateWindow(window.left,window.right);},_showImage:function(imageURL)
  9. {this._showImageForLayerCallback(this._layer,imageURL);},__proto__:WebInspector.SplitView.prototype};;WebInspector.LayersPanel=function()
  10. {WebInspector.PanelWithSidebarTree.call(this,"layers",225);this.registerRequiredCSS("timeline/timelinePanel.css");this._target=null;this.panelSidebarElement().classList.add("outline-disclosure","layer-tree");this.sidebarTree.element.classList.remove("sidebar-tree");WebInspector.targetManager.observeTargets(this);this._currentlySelectedLayer=null;this._currentlyHoveredLayer=null;this._layerTreeOutline=new WebInspector.LayerTreeOutline(this.sidebarTree);this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events.LayerSelected,this._onObjectSelected,this);this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events.LayerHovered,this._onObjectHovered,this);this._rightSplitView=new WebInspector.SplitView(false,true,"layerDetailsSplitViewState");this.splitView().setMainView(this._rightSplitView);this._layers3DView=new WebInspector.Layers3DView();this._rightSplitView.setMainView(this._layers3DView);this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectSelected,this._onObjectSelected,this);this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectHovered,this._onObjectHovered,this);this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.LayerSnapshotRequested,this._onSnapshotRequested,this);this._tabbedPane=new WebInspector.TabbedPane();this._rightSplitView.setSidebarView(this._tabbedPane);this._layerDetailsView=new WebInspector.LayerDetailsView();this._layerDetailsView.addEventListener(WebInspector.LayerDetailsView.Events.ObjectSelected,this._onObjectSelected,this);this._tabbedPane.appendTab(WebInspector.LayersPanel.DetailsViewTabs.Details,WebInspector.UIString("Details"),this._layerDetailsView);this._paintProfilerView=new WebInspector.LayerPaintProfilerView(this._layers3DView.showImageForLayer.bind(this._layers3DView));this._tabbedPane.appendTab(WebInspector.LayersPanel.DetailsViewTabs.Profiler,WebInspector.UIString("Profiler"),this._paintProfilerView);}
  11. WebInspector.LayersPanel.DetailsViewTabs={Details:"details",Profiler:"profiler"};WebInspector.LayersPanel.prototype={wasShown:function()
  12. {WebInspector.Panel.prototype.wasShown.call(this);this.sidebarTree.element.focus();if(this._target)
  13. this._target.layerTreeModel.enable();},willHide:function()
  14. {if(this._target)
  15. this._target.layerTreeModel.disable();WebInspector.Panel.prototype.willHide.call(this);},targetAdded:function(target)
  16. {if(this._target)
  17. return;this._target=target;this._target.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged,this._onLayerTreeUpdated,this);this._target.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted,this._onLayerPainted,this);if(this.isShowing())
  18. this._target.layerTreeModel.enable();},targetRemoved:function(target)
  19. {if(this._target!==target)
  20. return;this._target.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged,this._onLayerTreeUpdated,this);this._target.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerPainted,this._onLayerPainted,this);this._target.layerTreeModel.disable();this._target=null;},_showLayerTree:function(deferredLayerTree)
  21. {deferredLayerTree.resolve(this._setLayerTree.bind(this));},_onLayerTreeUpdated:function()
  22. {if(this._target)
  23. this._setLayerTree(this._target.layerTreeModel.layerTree());},_setLayerTree:function(layerTree)
  24. {this._layers3DView.setLayerTree(layerTree);this._layerTreeOutline.update(layerTree);if(this._currentlySelectedLayer&&(!layerTree||!layerTree.layerById(this._currentlySelectedLayer.layer.id())))
  25. this._selectObject(null);if(this._currentlyHoveredLayer&&(!layerTree||!layerTree.layerById(this._currentlyHoveredLayer.layer.id())))
  26. this._hoverObject(null);this._layerDetailsView.update();},_onLayerPainted:function(event)
  27. {if(!this._target)
  28. return;this._layers3DView.setLayerTree(this._target.layerTreeModel.layerTree());if(this._currentlySelectedLayer&&this._currentlySelectedLayer.layer===event.data)
  29. this._layerDetailsView.update();},_onObjectSelected:function(event)
  30. {var selection=(event.data);this._selectObject(selection);},_onObjectHovered:function(event)
  31. {var selection=(event.data);this._hoverObject(selection);},_onSnapshotRequested:function(event)
  32. {var layer=(event.data);this._tabbedPane.selectTab(WebInspector.LayersPanel.DetailsViewTabs.Profiler);this._paintProfilerView.profileLayer(layer);},_selectObject:function(selection)
  33. {var layer=selection&&selection.layer;if(this._currentlySelectedLayer===selection)
  34. return;this._currentlySelectedLayer=selection;var node=layer?layer.nodeForSelfOrAncestor():null;if(node)
  35. node.highlightForTwoSeconds();else if(this._target)
  36. this._target.domModel.hideDOMNodeHighlight();this._layerTreeOutline.selectLayer(layer);this._layers3DView.selectObject(selection);this._layerDetailsView.setObject(selection);},_hoverObject:function(selection)
  37. {var layer=selection&&selection.layer;if(this._currentlyHoveredLayer===selection)
  38. return;this._currentlyHoveredLayer=selection;var node=layer?layer.nodeForSelfOrAncestor():null;if(node)
  39. node.highlight();else if(this._target)
  40. this._target.domModel.hideDOMNodeHighlight();this._layerTreeOutline.hoverLayer(layer);this._layers3DView.hoverObject(selection);},__proto__:WebInspector.PanelWithSidebarTree.prototype}
  41. WebInspector.LayersPanel.LayerTreeRevealer=function()
  42. {}
  43. WebInspector.LayersPanel.LayerTreeRevealer.prototype={reveal:function(snapshotData)
  44. {if(!(snapshotData instanceof WebInspector.DeferredLayerTree))
  45. return Promise.reject(new Error("Internal error: not a WebInspector.DeferredLayerTree"));var panel=WebInspector.LayersPanel._instance();WebInspector.inspectorView.setCurrentPanel(panel);panel._showLayerTree((snapshotData));return Promise.resolve();}}
  46. WebInspector.LayersPanel._instance=function()
  47. {if(!WebInspector.LayersPanel._instanceObject)
  48. WebInspector.LayersPanel._instanceObject=new WebInspector.LayersPanel();return WebInspector.LayersPanel._instanceObject;}
  49. WebInspector.LayersPanelFactory=function()
  50. {}
  51. WebInspector.LayersPanelFactory.prototype={createPanel:function()
  52. {return WebInspector.LayersPanel._instance();}};